 // 基于准备好的dom，初始化echarts实例
 var myChart = echarts.init(document.getElementById("right-top"),'dark');
 // 指定图表的配置项和数据

     var jsonData = {
         name: [],
         count: []
     }
     $.ajax({
         url: '/data_province_confirmed_min',
         method: 'GET',
         dataType: 'json',
         success: function (data) {
             jsonData.name = data.name
             jsonData.count = data.count
             var option = {
                 title: {
                     text: '全球电影类型柱状图',
                     textStyle: {
                         fontSize: 18,
                         color: 'white'
                     },
                 },
                 tooltip: {
                     trigger: 'item',
                     formatter: '{a}<br/>{b}:{c}({d}%)'
                 },
                 legend: {
                     type: 'scroll',
                     orient: 'vertical',
                     right: 10,
                     top: 20,
                     bottom: 20,
                     data: jsonData.name,
                     selected: {
                         name: jsonData.name.slice(1, 10)
                     }
                 },
                 series: [{
                     name: '确诊人数',
                     type: 'pie',
                     radius: '55%',
                     center: ['40%', '50%'],
                     data: jsonData.count,
                     emphasis: {
                         itemStyle: {
                             shadowBlur: 10,
                             shadowOffsetX: 0,
                             shadowColor: 'rgba(0, 0, 0, 0.5)'
                         }
                     }
                 }]
             };

             // 使用刚指定的配置项和数据显示图表。
             myChart.setOption(option);
         },
         error: function (msg) {
             console.log(msg)
         }
     });